package com.hdl.school.bean;

public class SerialHexCode implements Comparable<SerialHexCode>{
    //发送内容
    private String code;
    //发送时间
    private long time;

    private String key;

    public SerialHexCode(String code, long time) {
        this.code = code;
        this.time = time;
    }

    public SerialHexCode(String code, long time, String key) {
        this.code = code;
        this.time = time;
        this.key = key;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    @Override
    public int compareTo(SerialHexCode serialHexCode) {
        return (int) (this.getTime()-serialHexCode.getTime());
    }
}
